/*
 * 

 * 
 */
package com.cheche.dn.common.base;

import com.cheche.dn.common.listener.EntityListener;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.validation.groups.Default;
import java.io.Serializable;

/**
 * Entity - 基类
 * 
 * 
 * @version 1.0
 */
@EntityListeners(EntityListener.class)
@MappedSuperclass
public abstract class BaseEntity extends IdEntity {

	private static final long serialVersionUID = -67188388306700736L;

	/** "创建日期"属性名称 */
	public static final String CREATE_DATE_PROPERTY_NAME = "createDate";

	/** "修改日期"属性名称 */
	public static final String MODIFY_DATE_PROPERTY_NAME = "modifyDate";

	/** 创建日期 */
	private Long createDate;

	/** 修改日期 */
	private Long modifyDate;

	/**
	 * 获取创建日期
	 * 
	 * @return 创建日期
	 */
	@JsonProperty
	@Column(nullable = false, updatable = false)
	public Long getCreateDate() {
		return createDate;
	}

	/**
	 * 设置创建日期
	 * 
	 * @param createDate
	 *            创建日期
	 */
	public void setCreateDate(Long createDate) {
		this.createDate = createDate;
	}

	/**
	 * 获取修改日期
	 * 
	 * @return 修改日期
	 */
	@JsonProperty
	@Column(nullable = false)
	public Long getModifyDate() {
		return modifyDate;
	}

	/**
	 * 设置修改日期
	 * 
	 * @param modifyDate
	 *            修改日期
	 */
	public void setModifyDate(Long modifyDate) {
		this.modifyDate = modifyDate;
	}

}